home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / ADSP.a next >
Encoding:
Text File  |  1996-01-24  |  7.9 KB  |  162 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ADSP.a
  3. ;
  4. ;    Contains:    AppleTalk Data Stream Protocol (ADSP) Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__ADSP__') = 'UNDEFINED' THEN
  21. __ADSP__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  30.     include 'AppleTalk.a'
  31.     ENDIF
  32. ;        include 'Types.a'                                            ;
  33. ;        include 'OSUtils.a'                                        ;
  34. ;            include 'MixedMode.a'                                    ;
  35. ;            include 'Memory.a'                                        ;
  36.  
  37. dspInit                            EQU        255                    ; create a new connection end 
  38. dspRemove                        EQU        254                    ; remove a connection end 
  39. dspOpen                            EQU        253                    ; open a connection 
  40. dspClose                        EQU        252                    ; close a connection 
  41. dspCLInit                        EQU        251                    ; create a connection listener 
  42. dspCLRemove                        EQU        250                    ; remove a connection listener 
  43. dspCLListen                        EQU        249                    ; post a listener request 
  44. dspCLDeny                        EQU        248                    ; deny an open connection request 
  45. dspStatus                        EQU        247                    ; get status of connection end 
  46. dspRead                            EQU        246                    ; read data from the connection 
  47. dspWrite                        EQU        245                    ; write data on the connection 
  48. dspAttention                    EQU        244                    ; send an attention message 
  49.  
  50. dspOptions                        EQU        243                    ; set connection end options 
  51. dspReset                        EQU        242                    ; forward reset the connection 
  52. dspNewCID                        EQU        241                    ; generate a cid for a connection end 
  53. ; connection opening modes 
  54. ocRequest                        EQU        1                    ; request a connection with remote 
  55. ocPassive                        EQU        2                    ; wait for a connection request from remote 
  56. ocAccept                        EQU        3                    ; accept request as delivered by listener 
  57. ocEstablish                        EQU        4                    ; consider connection to be open 
  58. ; connection end states 
  59. sListening                        EQU        1                    ; for connection listeners 
  60. sPassive                        EQU        2                    ; waiting for a connection request from remote 
  61. sOpening                        EQU        3                    ; requesting a connection with remote 
  62. sOpen                            EQU        4                    ; connection is open 
  63. sClosing                        EQU        5                    ; connection is being torn down 
  64. sClosed                            EQU        6                    ; connection end state is closed 
  65. ; client event flags 
  66. eClosed                            EQU        $80                    ; received connection closed advice 
  67. eTearDown                        EQU        $40                    ; connection closed due to broken connection 
  68. eAttention                        EQU        $20                    ; received attention message 
  69. eFwdReset                        EQU        $10                    ; received forward reset advice 
  70. ; miscellaneous constants 
  71. attnBufSize                        EQU        570                    ; size of client attention buffer 
  72. minDSPQueueSize                    EQU        100                    ; Minimum size of receive or send Queue 
  73.  
  74. ; connection control block 
  75. TRCCB                     RECORD    0
  76. ccbLink                     ds.l   1        ; offset: $0 (0)        ; link to next ccb 
  77. refNum                     ds.w   1        ; offset: $4 (4)        ; user reference number 
  78. state                     ds.w   1        ; offset: $6 (6)        ; state of the connection end 
  79. userFlags                 ds.b   1        ; offset: $8 (8)        ; flags for unsolicited connection events 
  80. localSocket                 ds.b   1        ; offset: $9 (9)        ; socket number of this connection end 
  81. remoteAddress             ds     AddrBlock ; offset: $A (10)        ; internet address of remote end 
  82. attnCode                 ds.w   1        ; offset: $E (14)        ; attention code received 
  83. attnSize                 ds.w   1        ; offset: $10 (16)        ; size of received attention data 
  84. attnPtr                     ds.l   1        ; offset: $12 (18)        ; ptr to received attention data 
  85. reserved                 ds.b   220        ; offset: $16 (22)        ; for adsp internal use 
  86. sizeof                     EQU *            ; size:   $F2 (242)
  87.                         ENDR
  88.  
  89. ; typedef struct TRCCB         TRCCB
  90. ; typedef TRCCB             *TPCCB
  91. ; typedef struct DSPParamBlock  DSPParamBlock, *DSPPBPtr
  92. DSPParamBlock             RECORD    0
  93. qLink                     ds.l   1        ; offset: $0 (0)
  94. qType                     ds.w   1        ; offset: $4 (4)
  95. ioTrap                     ds.w   1        ; offset: $6 (6)
  96. ioCmdAddr                 ds.l   1        ; offset: $8 (8)
  97. ioCompletion             ds.l   1        ; offset: $C (12)
  98. ioResult                 ds.w   1        ; offset: $10 (16)
  99. ioNamePtr                 ds.l   1        ; offset: $12 (18)
  100. ioVRefNum                 ds.w   1        ; offset: $16 (22)
  101. ioCRefNum                 ds.w   1        ; offset: $18 (24)        ; adsp driver refNum 
  102. csCode                     ds.w   1        ; offset: $1A (26)        ; adsp driver control code 
  103. qStatus                     ds.l   1        ; offset: $1C (28)        ; adsp internal use 
  104. ccbRefNum                 ds.w   1        ; offset: $20 (32)
  105. ccbPtr                     ds.l   1        ; offset: $22 (34)        ; pointer to connection control block 
  106. userRoutine                 ds.l   1        ; offset: $26 (38)        ; client routine to call on event 
  107. sendQSize                 ds.w   1        ; offset: $2A (42)        ; size of send queue (0..64K bytes) 
  108. sendQueue                 ds.l   1        ; offset: $2C (44)        ; client passed send queue buffer 
  109. recvQSize                 ds.w   1        ; offset: $30 (48)        ; size of receive queue (0..64K bytes) 
  110. recvQueue                 ds.l   1        ; offset: $32 (50)        ; client passed receive queue buffer 
  111. attnPtr                     ds.l   1        ; offset: $36 (54)        ; client passed receive attention buffer 
  112. localSocket                 ds.b   1        ; offset: $3A (58)        ; local socket number 
  113. filler1                     ds.b   1        ; offset: $3B (59)        ; filler for proper byte alignment 
  114.                          ORG 34
  115. localCID                 ds.w   1        ; offset: $22 (34)        ; local connection id 
  116. remoteCID                 ds.w   1        ; offset: $24 (36)        ; remote connection id 
  117. remoteAddress             ds     AddrBlock ; offset: $26 (38)    ; address of remote end 
  118. filterAddress             ds     AddrBlock ; offset: $2A (42)    ; address filter 
  119. sendSeq                     ds.l   1        ; offset: $2E (46)        ; local send sequence number 
  120. sendWindow                 ds.w   1        ; offset: $32 (50)        ; send window size 
  121. recvSeq                     ds.l   1        ; offset: $34 (52)        ; receive sequence number 
  122. attnSendSeq                 ds.l   1        ; offset: $38 (56)        ; attention send sequence number 
  123. attnRecvSeq                 ds.l   1        ; offset: $3C (60)        ; attention receive sequence number 
  124. ocMode                     ds.b   1        ; offset: $40 (64)        ; open connection mode 
  125. ocInterval                 ds.b   1        ; offset: $41 (65)        ; open connection request retry interval 
  126. ocMaximum                 ds.b   1        ; offset: $42 (66)        ; open connection request retry maximum 
  127. filler2                     ds.b   1        ; offset: $43 (67)        ; filler for proper byte alignment 
  128.                          ORG 34
  129. abort                     ds.b   1        ; offset: $22 (34)        ; abort connection immediately if non-zero 
  130. filler3                     ds.b   1        ; offset: $23 (35)        ; filler for proper byte alignment 
  131.                          ORG 34
  132. reqCount                 ds.w   1        ; offset: $22 (34)        ; requested number of bytes 
  133. actCount                 ds.w   1        ; offset: $24 (36)        ; actual number of bytes 
  134. dataPtr                     ds.l   1        ; offset: $26 (38)        ; pointer to data buffer 
  135. eom                         ds.b   1        ; offset: $2A (42)        ; indicates logical end of message 
  136. flush                     ds.b   1        ; offset: $2B (43)        ; send data now 
  137.                          ORG 34
  138. attnCode                 ds.w   1        ; offset: $22 (34)        ; client attention code 
  139. attnSize                 ds.w   1        ; offset: $24 (36)        ; size of attention data 
  140. attnData                 ds.l   1        ; offset: $26 (38)        ; pointer to attention data 
  141. attnInterval             ds.b   1        ; offset: $2A (42)        ; retransmit timer in 10-tick intervals 
  142. filler4                     ds.b   1        ; offset: $2B (43)        ; filler for proper byte alignment 
  143.                          ORG 34
  144. statusCCB                 ds.l   1        ; offset: $22 (34)        ; pointer to ccb 
  145. sendQPending             ds.w   1        ; offset: $26 (38)        ; pending bytes in send queue 
  146. sendQFree                 ds.w   1        ; offset: $28 (40)        ; available buffer space in send queue 
  147. recvQPending             ds.w   1        ; offset: $2A (42)        ; pending bytes in receive queue 
  148. recvQFree                 ds.w   1        ; offset: $2C (44)        ; available buffer space in receive queue 
  149.                          ORG 34
  150. sendBlocking             ds.w   1        ; offset: $22 (34)        ; quantum for data packets 
  151. sendTimer                 ds.b   1        ; offset: $24 (36)        ; send timer in 10-tick intervals 
  152. rtmtTimer                 ds.b   1        ; offset: $25 (37)        ; retransmit timer in 10-tick intervals 
  153. badSeqMax                 ds.b   1        ; offset: $26 (38)        ; threshold for sending retransmit advice 
  154. useCheckSum                 ds.b   1        ; offset: $27 (39)        ; use ddp packet checksum 
  155.                          ORG 34
  156. newcid                     ds.w   1        ; offset: $22 (34)        ; new connection id returned 
  157.                          ORG 68
  158. sizeof                     EQU *            ; size:   $44 (68)
  159.                         ENDR
  160.  
  161.     ENDIF ; __ADSP__
  162.